package com.demo.activemq;

import org.springframework.jms.core.JmsTemplate;

import javax.jms.Destination;

public abstract class AbstractActivemqProducer {
    private JmsTemplate jmsTemplate;
    private Destination destination;

    public AbstractActivemqProducer(JmsTemplate jmsTemplate, Destination destination) {
        this.jmsTemplate = jmsTemplate;
        this.destination = destination;
    }

    public void send(String msg){
        jmsTemplate.convertAndSend(destination, msg);
    }
}
